package cn.bone.ou.community.mapper;

import cn.bone.ou.community.bean.CommunityMng;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommunityMngMapper extends BaseMapper<CommunityMng> {

    /**根据小区id查询*/
    List<CommunityMng> listByCommunityId(@Param("communityId")Integer communityId,
                                         @Param("start")Integer start,
                                         @Param("num")Integer num);

    /**根据小区id查询总数*/
    int countListByCommunityId(@Param("communityId")Integer communityId);

    /**根据手机号查找*/
    CommunityMng getByPhoneNum(@Param("phoneNum")String phoneNum);

    /**根据手机号和id查找*/
    CommunityMng getByPhoneNumAndId(@Param("phoneNum")String phoneNum,
                                    @Param("mngId")Integer mngId);

    /**根据小区id查询所有已删除的管理员*/
    List<CommunityMng> listNotDel(@Param("communityId")Integer communityId,
                                  @Param("start")Integer start,
                                  @Param("num")Integer num);

    /**查询所有未删除的管理员总数*/
    int countListNotDel(@Param("communityId")Integer communityId);
}
